<include file="Public/header"/>
<div class="wrapper m-t">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <a class="h3 font-bold">会员中心【分组列表】</a>
            <a data-toggle="modal" data-target="#fenzu" class="btn btn-sm btn-primary m-l pull-right">新增分组</a>
        </div>
        <div class="ibox-content">

            <table class="table table-striped b-t b-light text-sm table-bordered">
                <thead>
                <tr>
                    <th width="10 "><input type="checkbox"></th>
                    <th>ID</th>
                    <th>名称</th>
                    <th>粉丝数量</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <volist name="fenzu" id="vo" key="k">
                    <tr>
                        <td><input type="checkbox" name="post[]" value="{$vo.id}"></td>
                        <td>{$vo.id}</td>
                        <td>{$vo.name}</td>
                        <td>{$vo.count}</td>
                        <td>
                            <a data-toggle="modal" data-target="#codes" onclick="codeimgs({$vo.id},'{$vo.name}')">二维码</a>&nbsp;&nbsp;|
                            <a data-toggle="modal" data-target="#fenzu" onclick="fansEdit({$vo.id},'{$vo.name}')" class="text-info">编辑</a>&nbsp;&nbsp;|
                            <a  href="{:U('Fans/fdel?id='.$vo[id])}" data-toggle="modal"  class="confirm ajax-get text-info">删除</a>
                        </td>
                    </tr>
                </volist>
                </tbody>
            </table>
            <div class="page">{$_page}</div>
        </div>
    </div>
</div>

<!--新增分组-->
<div class="modal inmodal" id="fenzu" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span onclick="$('#fzid').val('')" aria-hidden="true">&times;</span>
                    <span class="sr-only">关闭</span>
                </button>
                <h3 class="font-bold text-info"><i class="fa fa-edit"></i> 编辑分组</h3>
            </div>
            <form class="form-horizontal-f" action="{:U('Fans/fadd')}" method="post">
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">分组名称：</label>
                        <div class="col-sm-8">
                            <input type="hidden" value="" name="id" id="fzid"/>
                            <input type="text" name="fansname" value="" placeholder="分组名" class="form-control">
                            <span class="help-block m-b-none text-muted">请输入分组名</span>
                        </div>
                    </div>
                    <div class="clearfix"></div>

                </div>
                <div class="modal-footer">
                    <button type="submit" target-form="form-horizontal-f" class="ajax-post btn btn-info col-lg-2 col-lg-push-5" >提交</button>
                </div>
            </form>
        </div>
    </div>
</div>

<!--新增分组 endif-->

<div class="modal inmodal fade" id="codes" tabindex="-1" role="dialog"  aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="titles"></h4>
            </div>
            <div class="modal-body">
                <div id="code" style="margin-left: 10%;">
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>



<include file="Public/footer"/>
<script src="__PUBLIC__/Static/js/jquery.qrcode.min.js"></script>
<script>

    function codeimgs(id,name){
        $("#code").html('');
        var url="{:U('Fans/codeOperation')}?id="+id;
        $("#titles").html(name);
        $("#code").qrcode({
            render: "canvas", //或者table方式
            width: 200, //宽度
            height:200, //高度
            text:url , //任意内容

        });
    }



function fansEdit(id,name){
   $("#fzid").val(id);
   $("[name='fansname']").val(name);
}



</script>
























